/************************************************************************
Copyright 2003, 2004, 2005, 2006, 2007, 2008 Grid Technology Research Center,
National Institute of Advanced Industrial Science and Technology.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************/

package jp.aist.gtrc.plus.scheduler.status;

import java.util.Collection;

import jp.aist.gtrc.plus.scheduler.node.NodeInfo;
import jp.aist.gtrc.plus.scheduler.sys.SchedulerException;
import jp.aist.gtrc.plus.scheduler.sys.SignalType;

public abstract class QbaseMainServer implements MainServer {

	public abstract Collection<JobStatus> getJobStatus() throws SchedulerException;
	public abstract Collection<NodeStatus> getNodeStatus() throws SchedulerException;
	public abstract Collection<QueueStatus> getQueueStatus() throws SchedulerException;

	protected void unavailable(String func, String arg) throws SchedulerException {
		throw new SchedulerException("NOT IMPLEMENTED: " + func + " " + arg);
	}

	public void deleteJob(JobID jobID) throws SchedulerException {
		unavailable("deleteJob", jobID.toString());
	}

	public void holdJob(JobID jobID) throws SchedulerException {
		unavailable("holdJob", jobID.toString());
	}

	public void releaseJob(JobID jobID) throws SchedulerException {
		unavailable("releaseJob", jobID.toString());
	}

	public void rerunJob(JobStatus job) throws SchedulerException {
		unavailable("rerun", job.toString());
	}

	public void resumeJob(JobID jobID) throws SchedulerException {
		unavailable("resumeJob", jobID.toString());
	}

	public void runJob(JobID jobID, NodeStatus node) throws SchedulerException {
		unavailable("runJob", jobID.toString() + " at " + node.getName());
	}

	public void runJob(JobStatus job, Collection<NodeInfo> nodes)
			throws SchedulerException {
		unavailable("runJob", job.getJobID().toString() + " at " + nodes);
	}

	public void signalJob(JobID jobID, SignalType signal)
			throws SchedulerException {
		unavailable("signalJob", jobID.toString() + " " + signal.toString());
	}

	public void suspendJob(JobID jobID) throws SchedulerException {
		unavailable("suspendJob", jobID.toString());
	}

}
